WPS Office.apk(点击下载) / qbq.java


package defpackage;

import android.text.TextUtils;
import cn.wps.moffice.OfficeApp;
import cn.wps.moffice_eng.R;
import com.appsflyer.AppsFlyerProperties;
import com.iflytek.cloud.SpeechEvent;
import com.iflytek.cloud.SpeechUtility;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.TreeMap;
import org.json.JSONObject;

/* renamed from: qbq  reason: default package */
public final class qbq {
    private List<qbn> rTz;

    private List<qbn> aHo() {
        qbp qbp = (qbp) lvb.readObject(eCX(), qbp.class);
        if (qbp == null || Math.abs(System.currentTimeMillis() - qbp.dHM) >= 14400000) {
            return null;
        }
        return qbp.dHL;
    }

    private static List<qbn> eCW() {
        ArrayList arrayList = new ArrayList();
        try {
            TreeMap treeMap = new TreeMap();
            OfficeApp arx = OfficeApp.arx();
            treeMap.put("packagename", arx.getPackageName());
            treeMap.put("lang", eip.dHN);
            treeMap.put("version", arx.getString(R.string.app_version));
            treeMap.put("firstchannel", arx.arA());
            treeMap.put(AppsFlyerProperties.CHANNEL, arx.arB());
            String c = lwd.c(gqt.bTm() ? "https://moapi.wps.cn/background/list" : "https://service-api.kingsoft-office-service.com/background/list", lwd.r(treeMap), null);
            if (!TextUtils.isEmpty(c)) {
                JSONObject jSONObject = new JSONObject(c);
                if ("ok".equals(jSONObject.getString(SpeechUtility.TAG_RESOURCE_RESULT))) {
                    qbn[] qbnArr = (qbn[]) lvb.b(jSONObject.getString(SpeechEvent.KEY_EVENT_RECORD_DATA), qbn[].class);
                    for (qbn qbn : qbnArr) {
                        arrayList.add(qbn);
                    }
                }
            }
        } catch (Exception e) {
        }
        return arrayList;
    }

    public static String eCX() {
        return OfficeApp.arx().arM().lZN + (gqt.bTm() ? "readoption_cn.json" : "readoption_com.json");
    }

    public final boolean aGT() {
        if (!new File(eCX()).exists()) {
            this.rTz = null;
            return false;
        } else if (this.rTz != null) {
            return true;
        } else {
            List<qbn> aHo = aHo();
            if (aHo == null || aHo.size() <= 0) {
                return false;
            }
            this.rTz = aHo;
            return true;
        }
    }

    public final synchronized List<qbn> aGU() {
        List<qbn> list;
        if (this.rTz == null) {
            List<qbn> aHo = aHo();
            if (aHo == null || aHo.size() <= 0) {
                List<qbn> eCW = eCW();
                if (eCW.size() > 0) {
                    qbp qbp = new qbp();
                    qbp.dHL = eCW;
                    qbp.dHM = System.currentTimeMillis();
                    lvb.writeObject(qbp, eCX());
                    this.rTz = eCW;
                }
            } else {
                this.rTz = aHo;
                list = this.rTz;
            }
        }
        list = this.rTz;
        return list;
    }
}